#!/usr/bin/env python
# -*- encoding: utf-8 -*-

import datetime
import wsgiref.handlers
import os

from google.appengine.ext import webapp
from google.appengine.ext.webapp import template


class TimePage(webapp.RequestHandler):
  def get(self):
    template.register_template_library('DateConvModule')
    template_values = {
      't': datetime.datetime.now()
    }

    path = os.path.join(os.path.dirname(__file__), 'time.htm')
    self.response.out.write(template.render(path, template_values))


application = webapp.WSGIApplication([
  ('/', TimePage)
], debug=True)


def main():
  wsgiref.handlers.CGIHandler().run(application)


if __name__ == '__main__':
  main()
